#FROM eclipse-temurin:17-jre as builder
FROM bellsoft/liberica-runtime-container:jre-musl as builder
WORKDIR app
ARG JAR_FILE=target/*-exec.jar
COPY ${JAR_FILE} app.jar
RUN java -Djarmode=layertools -jar app.jar extract

#FROM eclipse-temurin:17-jre
FROM bellsoft/liberica-runtime-container:jre-musl
WORKDIR app
COPY --from=builder app/dependencies/ ./
COPY --from=builder app/spring-boot-loader/ ./
COPY --from=builder app/snapshot-dependencies/ ./
COPY --from=builder app/application/ ./
ENTRYPOINT ["java","org.springframework.boot.loader.launch.JarLauncher"]
EXPOSE 8099
